package com.ruoyi.business.controller;


import com.ruoyi.business.domain.MobileUserCollection;
import com.ruoyi.business.service.IMobileUserCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;


/**
 * @Author liumaotong
 * @Description 收藏
 * @Date 2024/6/14
 */
@RestController
@RequestMapping("/mobile/collection")
public class MobileUserCollectionController extends BaseController {

    @Autowired
    private IMobileUserCollectionService collectionService;

    /**
     * @Author liumaotong
     * @Description 收藏列表
     * @Date 2024/6/14
     * @Param [collection]
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/list")
    public AjaxResult collectionList(@RequestBody MobileUserCollection collection){
        return AjaxResult.success(collectionService.collectionList(collection));
    }

    /**
     * @Author liumaotong
     * @Description 收藏
     * @Date 2024/6/14
     * @Param [collection]
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/addCollection")
    public AjaxResult addCollection(@RequestBody MobileUserCollection collection){
        collectionService.addCollection(collection);
        return AjaxResult.success("收藏成功");
    }

    /**
     * @Author liumaotong
     * @Description 取消收藏
     * @Date 2024/6/14
     * @Param [collection]
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/deleteCollection")
    public AjaxResult deleteCollection(@RequestBody MobileUserCollection collection){
        collectionService.deleteCollection(collection);
        return AjaxResult.success("取消成功");
    }

}
